package vn.candyapp.qlct.utils;

import java.io.IOException;
import java.io.InputStream;

import android.content.Context;

public class IOHelper {
	
	public static String readFileFromAsset(Context context, String fileName) {
		StringBuilder sb = new StringBuilder();
		byte[] buffer = new byte[4096];
		int byteRead = 0;
		try {
			InputStream is = context.getAssets().open(fileName);
			while((byteRead = is.read(buffer)) != -1) {
				sb.append(new String(buffer, 0, byteRead));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return sb.toString();
	}
	
}
